package com.yao.mall.constant;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author jiahua.yao
 * @version 1.0
 * @description OSS服务配置常量
 * @date 2024/3/1 22:24
 */
@Component
public class OssConstant implements InitializingBean {
    @Value("${aliyun.oss.file.endPoint}")
    private String oss_file_endPoint;

    @Value("${aliyun.oss.file.keyId}")
    private String oss_file_keyId;

    @Value("${aliyun.oss.file.keySecret}")
    private String oss_file_keySecret;

    @Value("${aliyun.oss.file.bucketName}")
    private String oss_file_bucketName;
    @Value("${aliyun.mobile.keyId}")
    private String mobile_accessKeyId;
    @Value("${aliyun.mobile.keySecret}")
    private String mobile_accessKeySecret;



    public static String OSS_END_POINT_IM;
    public static String OSS_BUCKET_IM;
    public static String OSS_ACCESS_KEY_ID_IM;
    public static String OSS_ACCESS_KEY_SECRET_IM;

    public static String MOBILE_ACCESS_KEY_ID;
    public static String MOBILE_ACCESS_KEY_SECRET;

    @Override
    public void afterPropertiesSet() throws Exception {
        OSS_END_POINT_IM = oss_file_endPoint;
        OSS_BUCKET_IM = oss_file_bucketName;
        OSS_ACCESS_KEY_ID_IM = oss_file_keyId;
        OSS_ACCESS_KEY_SECRET_IM = oss_file_keySecret;
        MOBILE_ACCESS_KEY_ID = mobile_accessKeyId;
        MOBILE_ACCESS_KEY_SECRET = mobile_accessKeySecret;
    }
}


